package com.animationsp.acs.util;

import java.io.InputStream;
import java.util.Properties;

import com.qiniu.api.config.Config;

public class Constant {

	public static final String SESSION_USER = "news_session_user";

	public static final String COOKIE_NAME = "AspCloudStorage";
	
	public static final String COOKIE_USERID = "userId";
	
	public static final String COOKIE_USERNAME = "userName";

	public static final String COOKIE_NICKNAME = "nickName";

	public static final String COOKIE_LOGINKEY = "loginKey";

	public static final String COOKIE_APPID = "appId";
	
	
	// for qiniu
	public static final String AUTHORITY;
	public static final String PUBLIC = "public";
	public static final String PRIVATE = "private";
	
	public static final String DOMAIN;
	public static final String APP_NAME;
	public static final String BUCKET;
	public static final int PAGE_SIZE;
	public static final String SEPARATOR;
	
	// 文件列表排序
	public static final String SORT_KEY = "key";
	public static final String SORT_DATE = "date";
	public static final String SORT_SIZE = "size";
	public static final String ORDER_ASC = "asc"; // 升序
	public static final String ORDER_DESD = "desc";// 升序

	static {
		Properties props = new Properties();

		try {
			InputStream in = Constant.class.getResourceAsStream("/acs.properties");

			props.load(in);
			in.close();

		} catch (Throwable e) {
			e.printStackTrace();
		}

		AUTHORITY = props.getProperty("AUTHORITY");
		DOMAIN = props.getProperty("DOMAIN");
		BUCKET = props.getProperty("BUCKET");
		PAGE_SIZE = new Integer(props.getProperty("PAGE_SIZE"));
		SEPARATOR = props.getProperty("SEPARATOR");
		APP_NAME = props.getProperty("appName");
		
	}
}

